package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum CouponFullSubtraction {
	UNRESTRICTED(0,"不限制"),
	FULL_SUBTRACTION(1,"满减");
	
	private Integer value;
	private String text;
	
	private CouponFullSubtraction(Integer value,String text){
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}
	
	public static CouponFullSubtraction toStatus(Integer value) {
		if (UNRESTRICTED.value == value) {
			return UNRESTRICTED;
		} else if (FULL_SUBTRACTION.value == value) {
			return FULL_SUBTRACTION;
		} else {
			throw new InvalidArgumentException("Unknown OrderStatus[" + value + "].");
		}
	}
}
